{% extends 'myadmin/index.html' %}
{% block con %}
<link rel="stylesheet" type="text/css" href="/ueditor/UE/third-party/SyntaxHighlighter/shCoreDefault.css">
<script type="text/javascript" src="/ueditor/UE/third-party/SyntaxHighlighter/shCore.js"></script>
<script type="text/javascript" src="/ueditor/UE/ueditor.config.js"></script>
<script type="text/javascript" src="/ueditor/UE/ueditor.all.min.js"></script>
<script type="text/javascript" src="/ueditor/UE/lang/zh-cn/zh-cn.js"></script>
<div class="content">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-12">
                <div class="card">
                    <form action="{% url 'goods_insert' %}" method="POST" enctype="multipart/form-data"
                          class="am-form tpl-form-line-form">
                        {% csrf_token %}
                        <div class="card-header">
                            <div class="card-title">商品添加</div>
                        </div>

                        <div class="card-body">
                            <div class="form-group">

                                <label for="defaultSelect">所属分类</label>
                                <select name="cateid" class="form-control form-control" id="defaultSelect">
                                    <option value="0">--请选择分类--</option>
                                    {% for v in catelist%}
                                    <option value="{{v.id}}">{{v.sub}}{{v.name}}</option>
                                    {% endfor%}
                                </select>

                            </div>
                            <div class="form-group">
                                <label>商品名称</label>
                                <input type="text" class="form-control" name="goodsname"
                                       placeholder="请输入分类名称" value="{{goods.goodsname}}">
                            </div>
                            <div class="form-group">
                                <label>商品标题</label>
                                <input type="text" class="form-control" name="title"
                                       placeholder="请输入商品标题" value="{{goods.title}}">
                            </div>
                            <div class="form-group">
                                <label>商品原价</label>
                                <input type="text" class="form-control" name="oldprice"
                                       placeholder="请输入商品原价" value="{{goods.oldprice}}">
                            </div>
                            <div class="form-group">
                                <label>商品现价</label>
                                <input type="text" class="form-control" name="price"
                                       placeholder="请输入商品现价" value="{{goods.price}}">
                            </div>
                            <div class="form-group">
                                <label>商品数量</label>
                                <input type="text" class="form-control" name="goodsnum"
                                       placeholder="请输入商品数量" value="{{goods.goodsnum}}">
                            </div>
                            <div class="form-group">
                                <label>描述</label>
                                <textarea class="form-control" name="description" rows="5">{{goods.description}}</textarea>
                            </div>
                            <div class="form-group">
                                <label>商品介绍</label>
                                <script id="editor" name="goodsinfo" type="text/plain" style="height:500px;" value="{{goods.goodsinfo}}">

                                </script>
                                <script type="text/javascript">
                                    var ue = UE.getEditor('editor');
                                    SyntaxHighlighter.all();
                                </script>
                            </div>

                            <div class="form-group">
                                <label for="exampleFormControlFile1">封面图</label>
                                 <div class="am-u-sm-9">
                              <div class="am-form-group am-form-file">
                                  <div class="tpl-form-file-img">
                                      <img id="showImg" style="width: 200px;" src="assets/img/a5.png" alt="">
                                  </div>
                                  <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                    <i class="am-icon-cloud-upload"></i> 添加封面图片</button>
                                  <input id="ReadFile" name="pic" type="file" multiple="">
                              </div>
                          </div>
                            </div>
                            <div class="form-group">
                                <label for="exampleFormControlFile1">商品图片</label>
                                <div class="am-form-group am-form-file">
                                  <div class="tpl-form-file-img">
                                      <img id="showImgs" style="width: 200px;" src="assets/img/a5.png" alt="">
                                  </div>
                                  <button type="button" class="am-btn am-btn-danger am-btn-sm">
                                    <i class="am-icon-cloud-upload"></i> 添加商品图片</button>
                                  <input id="ReadFiles" name="pics" type="file" multiple="">
                              </div>
                            </div>
                            <div class="form-group">
                                <label for="exampleFormControlFile1">商品状态</label>
                                <p class="demo">
                                    <label class="form-radio-label">
                                        <input class="form-radio-input" type="radio" name="status" value="0">
                                        <span class="form-radio-sign">新品</span>
                                    </label>
                                    <label class="form-radio-label">
                                        <input class="form-radio-input" type="radio" name="status" value="1"
                                               checked>
                                        <span class="form-radio-sign">热卖</span>
                                    </label>
                                    <label class="form-radio-label">
                                        <input class="form-radio-input" type="radio" name="status" value="2"
                                               checked>
                                        <span class="form-radio-sign">推荐</span>
                                    </label>
                                    <label class="form-radio-label">
                                        <input class="form-radio-input" type="radio" name="status" value="3"
                                               checked>
                                        <span class="form-radio-sign">下架</span>
                                    </label>
                                </p>
                            </div>
                        </div>
                        <div class="card-action">
                            <button class="btn btn-success">添加</button>
                            <input class="btn btn-danger" type="submit" value="重置"/>
                        </div>
                </div>
                </form>
            </div>

        </div>
    </div>
</div>
</div>
{% endblock %}